package com.hsp.homework.homework13;

public class Student extends Person {
    private String stu_id;
    private String hobbit;

    public Student(String name, String sex, int age,String stu_id,String hobbit) {
        super(name, sex, age);
        this.stu_id = stu_id;
        this.hobbit = hobbit;

    }

    public String getStu_id() {
        return stu_id;
    }

    public void setStu_id(String stu_id) {
        this.stu_id = stu_id;
    }

    public String getHobbit() {
        return hobbit;
    }

    public void setHobbit(String hobbit) {
        this.hobbit = hobbit;
    }

    public String study(){
       return  "我承诺，我会好好学习";
    }
    @Override
    public String play() {
        return super.play()+hobbit;
    }

    @Override
    public String toString() {
        return "学生的信息:"+"\n"+
                "姓名："+getName()+"\n"+
                "年龄："+getAge()+"\n"+
                "性别:"+getSex()+"\n"+
                "stu_id：" + stu_id +"\n"+
                study()+"\n"+
                play();
    }

    public void printInfo(){
        System.out.println("学生的信息：");
        System.out.println(super.basicInfo());
        System.out.println("学号："+stu_id);
        study();
        System.out.println(play());
    }

//    @Override
//    public String toString() {
//        return "Student{" +
//                "stu_id=" + stu_id +
//                ", hobbit='" + hobbit + '\'' +
//                '}';
//    }
}
